hvmloader: fix vgatype detecting issue
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 22 Feb 2010 10:04:22 +0000 (10:04 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 22 Feb 2010 10:04:22 +0000 (10:04 +0000)
When graphics card is assigned to a guest as a secondary VGA,
without gfx_passthru and emulated VGA is the primary VGA,
hvmloader misreads gfx_passthru is specified if VGA device is
found after the emulated VGA.

This patch fix this issue. If emulated VGA is found, hvmloader
preserves it and loads vgabios of the emulated VGA.

Signed-off-by: Noboru Iwamatsu <n_iwamatsu@jp.fujitsu.com>
tools/firmware/hvmloader/hvmloader.c

index 6574a9baaea2836616ac9f7f67bb7bb759273d0f..be0c3ffb98faa904194ff09ba2cee8558e6045ad 100644 (file)
@@ -210,11 +210,12 @@ static void pci_setup(void)
         switch ( class )
         {
         case 0x0300:
+            /* If emulated VGA is found, preserve it as primary VGA. */
             if ( (vendor_id == 0x1234) && (device_id == 0x1111) )
                 virtual_vga = VGA_std;
             else if ( (vendor_id == 0x1013) && (device_id == 0xb8) )
                 virtual_vga = VGA_cirrus;
-            else
+            else if ( virtual_vga == VGA_none )
                 virtual_vga = VGA_pt;
             break;
         case 0x0680: